Using Salesforce
From APA 7.6, the Real-Time Designer provides functionality for connecting directly to Salesforce and handling Salesforce objects. By connecting directly to Salesforce, your solution can create, update and delete Salesforce objects.
Download the sample project here.
An updated sample for 7.7 includes the Connect with Webform function, as well as Download By Id and Download By Name events that trigger the related functions. Download this sample here.
For security reasons, NICE strongly recommends not hard-coding passwords for this functionality into the solution. Instead, the Client Credentials Management functionality should be used where credentials are stored at the server side and only accessed on use. This example is provided for you to test on a sandbox environment.
To use the sample Salesforce project:
1. | In Real-Time Designer, open the salesforce.dproj. |
2. | To use the application, add the required credentials to the relevant business entities (User, Password, Application Key, Application Secret, Endpoint URL, and Security Token). |
3. | Go to Business Logic > Event Handlers. The sample includes six event handlers that are triggered when the value of a corresponding business entity is modified: |
Connect & Initialize: Connects to Salesforce.
SOQL Querying: Queries Salesforce using SOQL, in this example, SELECT Description, Subject FROM Case WHERE Subject = 'New Subject'.
SOSL Querying: Queries Salesforce using SOSL, in this example, FIND {nice.com} IN Email Fields RETURNING Contact (name, phone, email).
Updating: Updates a Salesforce object, in this example, updates the description of a Salesforce case.
Deleting: Deletes a Salesforce object, in this example, deletes a Salesforce case.
Creating: Creates a Salesforce object, in this example, creates a Salesforce case.
4. | Click Run Main Project. |
5. | Click Monitor. |
6. | Test each of the functions, by selecting the Business Entities tab and changing the value of the associated property, starting with _Connect. |
7. | To check if the application connected to Salesforce, select the SF Connection business entity and check if Is Connected is set to True. |
8. | Test the rest of the functions in a similar way. |